package com.mario.provider.controller;

import com.mario.provider.entity.User;
import com.mario.provider.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/User")
public class UserController {

    @Autowired
    private UserService service;

    @RequestMapping("/findOne/{id}")
    public User findOne(@PathVariable("id") Integer id){
        User user = service.findUser(id);

        return user;
    }
}
